package com.zhou.common.mybatis.template.shiro.controller;

import com.zhou.common.mybatis.template.shiro.model.UserInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {
    @GetMapping("/index")
    public String test(){
        return "index";
    }


    @PostMapping("/index")
    public UserInfo test1(@RequestBody UserInfo userInfo){
        return userInfo;
    }

    @PostMapping("/index1")
    public UserInfo test2(String username,String role){
        UserInfo userInfo=new UserInfo();
        userInfo.setUsername(username);
        userInfo.setRole(role);
        return userInfo;
    }
}
